<me:UIWDECK x:Class="WPFExcelReport.TVKWD2PR"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
     xmlns:me="clr-namespace:WPFExcelReport"
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
     xmlns:PR="clr-namespace:WPFExcelReport;assembly=TICC_PRULES"  
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"  
    xmlns:ABK="clr-namespace:WPFExcelReport;assembly=TABKOPF"   
    xmlns:EV="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"  
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIWDECK.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWDECK.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*" MinHeight="300"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <StackPanel  Grid.Row="0">
        <WrapPanel Grid.Row="0">
            <Grid Margin="10,0,0,0" VerticalAlignment="Top" 
                  Visibility="{Binding IsOrder,ElementName=TV,Converter={StaticResource ResourceKey=bv}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Button Click="OrderCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Extend.png" />
                    </Button.Background>
                </Button>
                <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=供应}}"  ></TextBlock>
            </Grid>
            <Button  Click="NewCommand" Height="20" Margin="5,0,0,0" Width="20">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                </Button.Background>
            </Button>
            <Button   Click="RemoveCommand" Height="20" Margin="5,0,0,0" Width="20">
                <Button.Background>
                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                </Button.Background>
            </Button> 
            <TextBox   Name="txtDel" Text="N"></TextBox>  
        </WrapPanel> 
            <WrapPanel>
                <ex:TXT72 Text="{Binding SHIFT,ElementName=TV}" Width="120"/>
                <TextBlock Text="{Binding Source={Localization:Translate Word=需求:}}" ></TextBlock>
                <TextBlock   Text="{Binding WDBEDARF, Converter={StaticResource d100}}" MinWidth="60" />
                <EV:TBTNEXE INFO="留位:"
                            KEY="{Binding KEY,ElementName=TV}"
                            CMD="{Binding WZCMD,ElementName=TV}"
                            DLL="{Binding WZCMD,ElementName=TV}"
                            STWNW="{Binding WZCMD,ElementName=TV}"
                            />
                <TextBlock    Text="{Binding WDZUGET, Converter={StaticResource d100}}" MinWidth="60" />

                <TextBlock  Text="{Binding Source={Localization:Translate Word=预留:}}" ></TextBlock>
                <TextBlock   Text="{Binding WDRESERV, Converter={StaticResource d100}}" MinWidth="60"  />


                <TextBlock Text="{Binding Source={Localization:Translate Word=差异:}}" ></TextBlock>
                <TextBlock  Foreground="Red" Text="{Binding TOLOCK,ElementName=TV, Converter={StaticResource d100}}" MinWidth="60"  />
            </WrapPanel>
        </StackPanel>
        <Grid  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"  >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <PR:TFVKRULES  Name="cVKR"  Grid.Row="0"         
                     dwRule="{Binding dwRule,ElementName=TV}" 
                     ARTSTAGE="S" 
                     ORDERNUM="{Binding RULEKEY,ElementName=TV}"/>
            <MU:TABMU1 Name="cMU"   Grid.Row="1"  
                    EXAUF="{Binding KEY,ElementName=TV}"
                    dwMU="{Binding dwMU,ElementName=TV}"
                    />
            <ABK:TAB04 Name="cABK"   Grid.Row="2"  
                     IsAuto="True"  
                     AUFART="VA"
                     ORDERNUM="{Binding ABAUF,ElementName=TV}"  
                     />
        </Grid>
    </Grid>
</me:UIWDECK>
